package com.hxd.otc.common.enums;

import android.text.TextUtils;

import com.hxd.otc.R;
import com.hxd.otc.utils.ResourceUtil;

/**
 * Created by lzy on 2019/2/20 0020.
 * description ${无感广告商接单状态}
 */
public enum TakeOrderStatusEnum {
    InTheOrder("1", ResourceUtil.getString(R.string.in_the_order)),
    StopOrders("2", ResourceUtil.getString(R.string.stop_orders));

    private final String mStatus;
    private final String mDesc;

    TakeOrderStatusEnum(String status, String desc) {
        mStatus = status;
        mDesc = desc;
    }

    public String getStatus() {
        return mStatus;
    }

    public String getDesc() {
        return mDesc;
    }

    public static TakeOrderStatusEnum getInstance(String status) {
        if (TextUtils.isEmpty(status)) return null;
        for (TakeOrderStatusEnum singleStatus : TakeOrderStatusEnum.values()) {
            if (singleStatus.mStatus.equals(status)) return singleStatus;
        }
        return null;
    }

    @Override
    public String toString() {
        return "TakeOrderStatusEnum{" +
                "mStatus='" + mStatus + '\'' +
                ", mDesc='" + mDesc + '\'' +
                '}';
    }
}
